package com.ht.medicaltreatment.adapter

import android.text.TextUtils
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.ht.medicaltreatment.R
import com.ht.medicaltreatment.bean.CentrifugeNormalRecordBean

class SampleRecordAdapetr():BaseQuickAdapter<CentrifugeNormalRecordBean,BaseViewHolder>(R.layout.item_centrifuge_sample_record_layout) {
    init {
        addChildClickViewIds(R.id.btnRemark)
    }
    override fun convert(holder: BaseViewHolder, item: CentrifugeNormalRecordBean) {
        holder.setText(R.id.tvCode,"${getItemPosition(item)+1}")
        holder.setText(R.id.tvOrderName,item.name)
        holder.setText(R.id.tvStartTime,item.beginTime)
        if(TextUtils.isEmpty(item.remark)){
            holder.setVisible(R.id.btnRemark,true)
        }else{
            holder.setGone(R.id.btnRemark,true)
            holder.setText(R.id.tvRemark,item.remark)
        }
    }

}
